using System;
using System.Collections.Generic;
using System.Text;
using Css.Diagnostics;
using SecuBat.Logging.Interface;

namespace SecuBat.Logging
{
    public static class LogManager
    {
        private static ILogSink _sink = null;

        public static void SetSink(ILogSink sink)
        {
            _sink = sink;
        }

        public static void Write(TraceLevel level, String message, String category)
        {
            if (_sink != null)
                _sink.WriteLogMessage(level, message, category);
            else
                throw new ApplicationException("No sink was provided at the moment!");
        }

        public static void Write(TraceLevel level, Exception ex, String category)
        {
            if (_sink != null)
                _sink.WriteLogMessage(level, ex, category);
            else
                throw new ApplicationException("No sink was provided at the moment!");
        }


    }
}
